#!/bin/bash
set -eu

touch $LOGDIR/skip.updatebase

mount --rbind /dev $FAI_ROOT/dev
mount --make-private $FAI_ROOT/dev
mount --bind /proc $FAI_ROOT/proc
mount --make-private $FAI_ROOT/proc
mount --bind /sys $FAI_ROOT/sys
mount --make-private $FAI_ROOT/sys
mount -t tmpfs none $FAI_ROOT/var/tmp
mount --make-private $FAI_ROOT/var/tmp
mount -t tmpfs none $FAI_ROOT/tmp
mount --make-private $FAI_ROOT/tmp

aptopt="-y -o Dpkg::Options::=--force-confnew"
$ROOTCMD apt-get -y update
$ROOTCMD apt-get $aptopt dist-upgrade < /dev/null
